package com.cby.operation.pay.bean

import android.os.Parcel
import android.os.Parcelable

/**
 * Description:HykbPayLimit
 *
 * @author 陈宝阳
 * @create 2020/8/14 15:31
 */
data class PayLimit(
    /**
     * "content": "您未满8岁，无法充值。感谢您的理解。",
     * "tips": "小娃娃，长大点再来充钱啊",
     * "link": {
     * "name": "查看详情",
     * "url": "https://cdn.h5wan.4399sj.com/static/addiction/recharge.html"
     * },
     * "buttons": [
     * {
     * "name": "关闭",
     * "action": "exit_popup"
     * }
     * ]
     */
    /** 健康系统提示  */
    var content: String? = null,

    /** 温馨提示  */
    var tips: String? = null,

    /** 查看详情  */
    var linkInfo: LinkInfo? = null,

    /** 按钮内容  */
    var buttonInfoList: List<ButtonInfo>? = null

)  : Parcelable {

    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readParcelable(LinkInfo::class.java.classLoader),
        parcel.createTypedArrayList(ButtonInfo)
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(content)
        parcel.writeString(tips)
        parcel.writeParcelable(linkInfo, flags)
        parcel.writeTypedList(buttonInfoList)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<PayLimit> {
        override fun createFromParcel(parcel: Parcel): PayLimit {
            return PayLimit(parcel)
        }

        override fun newArray(size: Int): Array<PayLimit?> {
            return arrayOfNulls(size)
        }
    }

}